package cn.ztr.ymcc.feign.Impl;

import cn.ztr.ymcc.result.JsonResult;
import cn.ztr.ymcc.feign.UserFeign;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserFeignImpl implements FallbackFactory<UserFeign> {
    @Override
    public UserFeign create(Throwable throwable) {
        return new UserFeign() {
            @Override
            public JsonResult findByPhone(String phone) {
                return JsonResult.error("手机号查询用户失败"+throwable.getMessage());
            }
        };
    }
}
